<template>
  <view class="black">
    <swiper class="swiper3" vertical :current="current">
      <swiper-item v-for="(item,index) in randlist" :key="index">
        <video class="video_play" id="myVideo" :src="item.vod_url || 'http://67.21.71.210/20211123/4ybNxsEV/index.m3u8'"
          controls></video>
        <view class="tag">
          <p>@{{item.vod_tag}}</p>
          <p>《{{item.vod_type}}》</p>
          <p>{{item.vod_name}}</p>
        </view>
        <view class="icon">
          <view class="inox_left_img" :style="{'backgroundImage':'url('+item.vod_pic+')' }"></view>
          <image class="img2" src="@/static/img/e.png" mode=""></image>
          <p>{{item.vod_play}}</p>
          <view class="rotate">
            <view class="inox_left_img1" :style="{'backgroundImage':'url('+item.vod_pic+')' }"></view>
          </view>

        </view>
      </swiper-item>
    </swiper>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        vedioUrl: '',
        randlist: []
      }
    },
    onLoad() {
      uni.showLoading({
        title: '加载中'
      })
      this.$http.randlist().then(res => {
        if (res.code == 200) {
          this.randlist = res.data.randlist;
          uni.hideLoading()
        }
      })
      
      this.$http.sclist().then(res => {
        console.log(res)
      }).catch(err=>{
        console.log(err,123)
      })

    }
  }
</script>

<style lang="less">
  .black {
    width: 100%;
    height: 100vh;
    background-color: black;



    .swiper3 {
      position: relative;
      width: 100%;
      height: 100vh;
      background-color: black;

      swiper-item {}

      .video_play {
        position: absolute;
        top: 25%;
        width: 100%;
      }

      .tag {
        position: absolute;
        top: 80%;
        left: 2%;

        p {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          width: 280rpx;

          color: white;
        }
      }

      .icon {
        position: absolute;
        text-align: center;
        top: 77%;
        right: 2%;

        .inox_left_img {
          width: 80rpx;
          height: 80rpx;
          background-repeat: no-repeat;
          background-size: cover;
          background-position: 50%;
          border-radius: 50%;
        }

        .rotate {
          height: 45px;
          width: 45px;
          background: #2e2e2e;
          border-radius: 50%;
          display: flex;
          justify-content: center;
          align-items: center;
          animation: move 2s linear infinite;

          .inox_left_img1 {
            padding: 5rpx;
            background-color: #FFFFFF;
            width: 60rpx;
            height: 60rpx;
            background-repeat: no-repeat;
            background-size: cover;
            background-position: 50%;
            border-radius: 50%;
          }

        }



        p {
          color: #FFFFFF;
        }

        .img2 {
          width: 50rpx;
          height: 50rpx;
        }

        .img3 {
          width: 60rpx;
          height: 60rpx;
          border-radius: 50%;
        }
      }
    }
  }

  @keyframes move {
    from {
      transform: rotateZ(0deg);
    }

    to {
      transform: rotateZ(360deg);
    }
  }
</style>
